package test;

import com.alibaba.excel.EasyExcel;
import com.carey.yygh.model.cmn.Dict;

import java.util.ArrayList;
import java.util.List;

public class excel {
    public static void main(String[] args) {
        List<User> list = new ArrayList<>();

        for (int i = 0; i < 10; i++) {
            User user = new User();
            user.setId(i);
            user.setName("lucy"+i);
            list.add(user);
        }

        //设置文件路径和名称
        String filename = "/Users/carey-/Desktop/test/test3.xlsx";

        EasyExcel.write(filename,User.class).sheet("用户信息").doWrite(list);
    }
}
